package com.gongj.applyMerged;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationUtils;

import java.CC;
import java.lang.annotation.Annotation;
import java.util.LinkedHashSet;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
		AA aa = (AA)context.getBean("AA");
		System.out.println(aa);
	}

	//测试 is
	public static void main2(String[] args) {
		Set<Class<? extends Annotation>> autowiredAnnotationTypes = new LinkedHashSet<>(4);
		autowiredAnnotationTypes.add(Autowired.class);
		autowiredAnnotationTypes.add(Value.class);
		//autowiredAnnotationTypes.add(CC.class);
		boolean candidateClass = AnnotationUtils.isCandidateClass(CC.class, autowiredAnnotationTypes);
		System.out.println(candidateClass);
	}
}
